<template>
	<view class="padd">
		<view class="zxsList" 
			v-for="(item,index) in zxsList"
			:key="index"
			@tap="goZxsDet(item.workerId)">
			<view class="header">
				<image class="samePar" mode="aspectFill" :src="getCloudFilePath(item.zjImg)"></image>
			</view>
			<view class="zxsInfo">
				<view class="zxsName hasFlex">
					<view class="userName">{{item.userName}}</view>
					<view class="recTag" v-if="item.tjTag == 1">荐</view>
				</view>
				<view class="zxsLevel">{{formatZsName(item.zsName)}}</view>
				<view class="scly hasFlex" style="flex-wrap: wrap;">
					<view class="lyItem"
						v-for="(innerItem,innerIndex) in calZsName(item.scRange)"
						:key="innerIndex"
					>{{innerItem}}</view>
				</view>
				<view class="zxTime hasFlex">
					<view class="zxNum">{{item.serviceTimes}}人咨询</view>
					<view>服务时长{{item.serviceHours}}小时</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		props:{
			zxsList:Array
		},
		computed:{
			formatZsName(){
				return function(zsName){
					return zsName.split(',')[0]
				}
			},
			calZsName(){
				return function(zsName){
					if(zsName != ''){
						var tmpArr = zsName.split(',');
						return tmpArr;
					}
				}
			}
		},
		methods:{
			goZxsDet(workerId){
				this.$emit('goZxsDet',workerId);
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '../../../static/scss/zxsList.scss';
</style>